package com.ruoyi.market.service.impl;

import com.ruoyi.market.domain.ConfigOrder;
import com.ruoyi.market.mapper.ConfigOrderMapper;
import com.ruoyi.market.service.IConfigOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 店铺订单配置 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class ConfigOrderServiceImpl implements IConfigOrderService
{

    @Autowired
    private ConfigOrderMapper configOrderMapper;

    /**
     * 根据条件分页查询店铺订单配置列表
     * 
     * @param configOrder 店铺订单配置信息
     * @return 店铺订单配置信息集合信息
     */
    @Override
    public List<ConfigOrder> selectConfigOrderList(ConfigOrder configOrder)
    {
        return configOrderMapper.selectConfigOrderList(configOrder);
    }

    /**
     * 通过店铺订单配置ID查询店铺订单配置
     * 
     * @param shopId 店铺ID
     * @return 店铺订单配置对象信息
     */
    @Override
    public ConfigOrder selectConfigOrderByShopId(String shopId)
    {
        return configOrderMapper.selectConfigOrderByShopId(shopId);
    }

    /**
     * 新增保存店铺订单配置信息
     * 
     * @param configOrder 店铺订单配置信息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertConfigOrder(ConfigOrder configOrder)
    {
        // 新增店铺订单配置信息
        int rows = configOrderMapper.insertConfigOrder(configOrder);
        return rows;
    }

    /**
     * 修改保存店铺订单配置信息
     * 
     * @param configOrder 店铺订单配置信息
     * @return 结果
     */
    @Override
    @Transactional
    public int updateConfigOrder(ConfigOrder configOrder)
    {
        return configOrderMapper.updateConfigOrder(configOrder);
    }

    /**
     * 批量删除店铺订单配置信息
     * 
     * @param configOrderIds 需要删除的店铺订单配置ID
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteConfigOrderByIds(Long[] configOrderIds) { return configOrderMapper.deleteConfigOrderByIds(configOrderIds); }
}
